<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
  <style scoped>
    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 20px;
    }

    h1 {
      text-align: center;
      margin-bottom: 20px;
    }

    .menu {
      margin-bottom: 20px;
    }

    .el-footer {
      text-align: center;
      margin-top: 20px;
    }
  </style>
</head>
<body>
<div id="app">
  <template>
    <div class="container">
      <h1>仓储管理系统</h1>
      <el-menu :default-active="activeIndex" class="menu" mode="horizontal" @select="handleMenuSelect">
        <el-menu-item index="home">首页</el-menu-item>
        <el-submenu index="inventory">
          <template slot="title">库存管理</template>
          <el-menu-item index="inventoryList">库存列表</el-menu-item>
          <el-menu-item index="addInventory">添加库存</el-menu-item>
        </el-submenu>
        <el-menu-item index="order">订单管理</el-menu-item>
        <el-menu-item index="inOut">出入库管理</el-menu-item>
        <el-menu-item index="report">统计报表</el-menu-item>
        <el-menu-item index="settings">系统设置</el-menu-item>
      </el-menu>
      <el-main>
        <router-view></router-view>
      </el-main>
      <el-footer>
        <p>版权所有 &copy; 2021 仓储管理系统</p>
      </el-footer>
    </div>
  </template>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
 let v = new Vue({
    el: '#app',
    data: function() {
      return {
        activeIndex: 'home'
      }
    },
   methods:{
     handleMenuSelect(index) {
       this.activeIndex = index;
       this.$router.push({ path: `/${index}` });
     }
   }
  })
</script>
</html>